arm64: KVM: Sanitize PSTATE.M when being set from userspace
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 27 Sep 2018 15:53:22 +0000 (16:53 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 7 Oct 2018 20:57:06 +0000 (21:57 +0100)
commit51237335a27dc447835238497e7c15dde3a4b082
tree20aeef439ba97542dd2efc8d925216953a6a6942
parentaeca19127919475b16a3340c4eed0bfb3c374436
arm64: KVM: Sanitize PSTATE.M when being set from userspace

Not all execution modes are valid for a guest, and some of them
depend on what the HW actually supports. Let's verify that what
userspace provides is compatible with both the VM settings and
the HW capabilities.

Cc: <stable@vger.kernel.org>
Fixes: 0d854a60b1d7 ("arm64: KVM: enable initialization of a 32bit vcpu")
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[carnil: Backport for 4.18: Cherrypick directly commit from 4.18.12 /
926415e1e4c9]

Gbp-Pq: Topic bugfix/arm64
Gbp-Pq: Name arm64-kvm-sanitize-pstate.m-when-being-set-from-user.patch
arch/arm64/kvm/guest.c